namespace ConsoleApp1._1013;
//键盘录入一个正整数，请求：1.它是几位数？2.逆序打印出各位数字
using System;

public class five
{
    public static void run()
    {
        Console.Write("请输入一个正整数：");
        int num = int.Parse(Console.ReadLine());
        int originalNum = num;
        int digitCount = 0;
        int[] digits = new int[10]; 
        while (num > 0)
        {
            digits[digitCount] = num % 10;
            num /= 10;
            digitCount++;
        }

        Console.WriteLine($"{originalNum} 是 {digitCount} 位数");
        Console.Write("逆序各位数字为：");
        for (int i = 0; i < digitCount; i++)
        {
            Console.Write(digits[i]);
        }
        Console.WriteLine();
    }
}

